/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.awt.Color;
import java.awt.Graphics;

/**
 *
 * <p>
 * Title: DrawableGraph</p>
 * <p>
 * Description: CS 343 Project. Allows Graph to be drawn onto the graphics.</p>
 *
 * @date 11/18/2013
 *
 * @author Dylan Ahmann - Route programming
 * @author Gregg Roemhildt - Class programming and Javadocs
 * @author Sam Brockmann - Javadocs
 * @author Emily Hancock - Route programming
 * @author Shirin Asadi
 *
 */
public class DrawableGraph extends Graph<double[]> implements Drawable {

    /**
     * default constructor
     */
    public DrawableGraph() {
        super();
    }

    /**
     * copy constructor
     *
     * @param g graph to copy from
     */
    public DrawableGraph(Graph g) {
        super(g);
    }

    /**
     * paint Paints a graph on the map.
     *
     * @param g graphics to paint the graph on
     *
     * Paints a graph on the map.
     *
     */
    @Override
    public void paint(Graphics g) {
        for (Vertex<double[]> v : vertices) {
            DrawableVertex d = new DrawableVertex(v);
            d.paint(g);
        }
        for (Edge<double[]> e : edges) {
            DrawableEdge d = new DrawableEdge(e);
            d.paint(g);
        }
    }

    /**
     * paint (overloaded) Paints a graph on the map.
     *
     * @param g defines color pattern
     * @param x x-offset
     * @param y y-offset
     * @param z zoom level
     */
    public void paint(Graphics g, double x, double y, double z) {
        g.setColor(Color.DARK_GRAY);
        for (Vertex<double[]> v : vertices) {
            DrawableVertex d = new DrawableVertex(v);
            d.paint(g, x, y, z);
        }
        for (Edge<double[]> e : edges) {
            DrawableEdge d = new DrawableEdge(e);
            d.paint(g, x, y, z);
        }
    }
}
